
/**
 * 正则校验是否为rgb颜色
 * @param pressColor 颜色值
 */
export const rgbTest = (pressColor: string) => {
    const rgbRegex = /^rgb\(\s*(25[0-5]|2[0-4]\d|1?\d?\d)\s*,\s*(25[0-5]|2[0-4]\d|1?\d?\d)\s*,\s*(25[0-5]|2[0-4]\d|1?\d?\d)\s*\)$/;
    return rgbRegex.test(pressColor)
} 